'use strict';

module.exports = (app) => {
  weixin(app);
  web(app);
  api(app);
};

function weixin(app) {
  const wxApi = app.middlewares.weixinApi(app.config, app);
  console.log('################', wxApi);
  app.post('/wx', wxApi, app.controller.weixin.callback);
  app.get('/wx', wxApi, app.controller.weixin.callback);
  if (app.config.weixin.verifyFile) {
    app.get(
      `/MP_verify_${app.config.weixin.verifyFile}.txt`,
      app.controller.weixin.verify
    );
  }
}

function web(app) {
  const oauth = app.middlewares.weixinOauth(app.config, app);
  const wxApi = app.middlewares.weixinApi(app.config, app);
  app.get('/page/:pageId', app.controller.web.staticPage);
  app.get('/user/login', oauth, app.controller.web.empty);
  app.get('/user/memberType', oauth, app.controller.web.userMemberType);
  app.get(
    '/requirementListUseNum',
    oauth,
    app.controller.web.requirementListUseNum
  ); //需求单用法用量
  app.get('/requirementList', oauth, app.controller.web.requirementList); //需求单
  app.get('/requirementListDemo', app.controller.web.requirementList); //需求单Demo
  app.get('/checkSuccess', app.controller.web.checkSuccess); //结算
  app.get('/check', oauth, app.controller.web.check); //结算
  app.get('/checkDemo', app.controller.web.check); //结算Demo,演示使用
  // 支付页面
  app.get('/payDemo', app.controller.web.check); //结算Demo,演示使用

  app.get('/points', oauth, app.controller.web.points); //结算
  app.get('/user/logout', oauth, app.controller.web.empty);
  app.get('/user/wx-redirect', oauth, app.controller.web.empty);
  app.get('/not-bound', oauth, app.controller.web.notBound);
  // app.get('/user/info', oauth, app.controller.web.userInfo);
  app.get(`/orderRetrun/:orderId`, oauth, app.controller.web.returnDetail);
  app.get(`/order/:orderId`, oauth, app.controller.web.orderDetail);
  // demo
  app.get(`/orderDemo/:orderId`, app.controller.web.orderDetailDemo);
  app.get(`/addressList`, oauth, app.controller.web.addressList);
  app.get('/hospitals', wxApi, app.controller.web.hospitals);
  app.get('/drugs', wxApi, app.controller.web.druglist);
  app.get('/drugDetail/:hospitalId/:drugId', app.controller.web.drugDetail);
  app.get('/hd/:hospitalId', oauth, app.controller.web.druglist);
  app.get('/user/bind', wxApi, oauth, app.controller.web.userBind);
  app.get('/demo', wxApi, app.controller.web.demo);
  // demo页面
  app.get('/user/bindDemo', app.controller.web.userBindDemo);
  app.get('/selforder', wxApi, oauth, app.controller.web.selfOrder);
  app.get(
    '/selforder/selfDrugDetail/:hospitalId/:drugId',
    wxApi,
    oauth,
    app.controller.web.empty
  );
  app.get(
    '/selforder/searchDrug/:hospitalId/:patientId',
    wxApi,
    oauth,
    app.controller.web.empty
  );
  app.get('/send-drug', app.controller.web.sendDrug);
  app.get('/send-drug-login', app.controller.web.sendDrugLogin);
  app.get(
    '/send-drug-details/:orderfillNo',
    app.controller.web.sendDrugDetails
  );
  app.get('/static/*', app.controller.web.staticAssets);
  app.get('/patient/service', app.controller.web.patientService);
  app.get('/patient/detail', app.controller.web.patientDetails);
  app.get('/record', oauth, app.controller.web.record);
  app.get(
    '/record/cancelReason/:orderId',
    oauth,
    app.controller.web.cancelReason
  );
  app.get(
    '/record/orderSchedule/:orderId',
    oauth,
    app.controller.web.orderSchedule
  );
  app.get(
    '/register/:activityId/:channelType/:channelId',
    wxApi,
    app.controller.web.potentialPatients
  );
  app.get('/user/register', oauth, wxApi, app.controller.web.register);
  app.get(
    '/improveInformation',
    oauth,
    wxApi,
    app.controller.web.improveInformation
  );
  app.get('/newAndCourteous', oauth, wxApi, app.controller.web.newAndCourteous);
  app.get('/newShare/:patientId', wxApi, app.controller.web.newAndShare);
  app.get('/notComplete', oauth, wxApi, app.controller.web.notComplete);
  // 找药
  app.get('/newDrugSearch', oauth, wxApi, app.controller.web.newDrugSearch);
  // 找药的demo页面
  app.get('/newDrugSearchDemo', app.controller.web.newDrugSearch);
  app.get('/newDrugDetail', oauth, wxApi, app.controller.web.newDrugDetail);
  // 药品详情页demo
  app.get('/newDrugDetailDemo', app.controller.web.newDrugDetail);
  app.get(
    '/medicineHomePage',
    oauth,
    wxApi,
    app.controller.web.medicineHomePage
  );
  // 找药的demo演示页
  app.get(
    '/medicineHomePageDemo',
    app.controller.web.medicineHomePageDemo
  );

  // 我的
  app.get('/user/info', oauth, app.controller.web.newUserInfo);
  // 订单列表
  app.get('/newOrderList', oauth, app.controller.web.newOrderList);
  // 订单demo页
  app.get('/newOrderListDemo', oauth, app.controller.web.newOrderList);
  // 基本信息
  app.get('/newUserMember', oauth, app.controller.web.newUserMember);
  // 一键续订
  app.get('/orderCommonList', oauth, app.controller.web.orderCommonList);
  // 会员日
  app.get('/vipDay', oauth, app.controller.web.vipDay);
  // 优惠券活动
  app.get('/newCoupon', oauth, app.controller.web.newCoupon);

  //保险跳转页面
  app.get('/insuranceRoute', oauth, app.controller.web.insuranceRoute);
  //保险登记
  app.get(
    '/insurance/:insurancePackageId',
    oauth,
    app.controller.web.defaultPage
  );
  //健康问询
  app.get(
    '/insuranceDisease/:insurancePackageId',
    oauth,
    app.controller.web.defaultPage
  );
  app.get(
    '/insuranceDiseaseV2/:insurancePackageId',
    oauth,
    app.controller.web.defaultPage
  );
  //服务单详情
  app.get(
    '/serviceInfo/:insurancePackageId',
    oauth,
    app.controller.web.defaultPage
  );
  //保单详情
  app.get(
    '/insurances/:serviceId/:productName',
    oauth,
    app.controller.web.insurance
  );
  //登记成功
  app.get(
    '/insurancePaySuccess/:insuranceId',
    oauth,
    app.controller.web.insurancePaySuccess
  );
  //保障服务方案
  app.get(
    '/insuranceServicePlan/:insurancePackageId',
    oauth,
    app.controller.web.insuranceServicePlan
  );
  // 新增健康首页
  app.get('/newHealthHomePage', oauth, app.controller.web.newHealthHomePage);
  // 购药凭证
  app.get(
    '/newMedicineCredentials',
    oauth,
    app.controller.web.newMedicineCredentials
  );
  /* 怎么使用积分 */
  app.get('/howToUsePoint', oauth, app.controller.web.howToUsePoint);
  /* 积分规则 */
  app.get('/pointRule', oauth, app.controller.web.pointRule);
  /* 分享万户宝 */
  app.get('/sharePage', oauth, app.controller.web.sharePage);
  /* 分享出去的页面 */
  app.get('/shareToOther', oauth, app.controller.web.shareToOther);
  /* 保险订单详情 */
  app.get('/insurances/:insuranceId', oauth, app.controller.web.insuranceInfo);
  /* 保险订单列表 */
  app.get('/insuranceList', oauth, app.controller.web.insuranceList);
  /* 保障列表 */
  app.get('/ensureList', oauth, app.controller.web.ensureList);
  /* BMI */
  app.get('/newBMI', oauth, app.controller.web.newBMI);
  /* 积分兑换 */
  app.get('/exchangeList', oauth, app.controller.web.exchangeList);
  app.get('/exchange/:exchangeId', oauth, app.controller.web.exchangeInfo);
  app.get('/gatherHappiness', oauth, app.controller.web.gatherHappiness);
  /* 城市选择 */
  app.get('/addressSelect', oauth, app.controller.web.addressSelect);

  app.get('/notice', app.controller.web.getNotice);
  /* 城市选择 */
  app.get('/addressSelect', oauth, app.controller.web.addressSelect);
  app.get('/ads/video', app.controller.web.adsVedio);
  app.get('/ads/cardForm', app.controller.web.adsVedio);
  app.get('/ads/insuranceForm', app.controller.web.adsVedio);
  /**跳转小程序 */
  app.get('/redirect/miniProgram', oauth, app.controller.web.defaultPage);

  /* 用药评估 */
  app.get('/drugEvaluation', oauth, app.controller.web.drugEvaluation);
  /* 参评人员 */
  app.get('/evaluationPatient', oauth, app.controller.web.evaluationPatient);
  /* 参评药品信息 */
  app.get('/evaluationDrugInfo', oauth, app.controller.web.evaluationDrugInfo);
  /* 参评结果 */
  app.get('/evaluationResult', oauth, app.controller.web.evaluationResult);
  app.get(
    '/evaluationDrugSearch',
    oauth,
    app.controller.web.evaluationSearchDrug
  );

  app.get('/health', app.controller.web.defaultPage);

  /* 健康课堂 */
  app.get('/healthClass', app.controller.web.healthClass);
  app.get('/healthNewsPage', app.controller.web.healthNewsPage);

  /* 体检 */
  app.get('/healthPhysical', app.controller.web.healthPhysical);

  app.get('/toBaiji', oauth, app.controller.web.toBaiji);
  app.get('/myMedicalReport', oauth, app.controller.web.myMedicalReport);
  app.get('/myReportInfo', oauth, app.controller.web.myReportInfo);
  app.get('/myDoctor', oauth, app.controller.web.myDoctor);
  app.get('/anxinInsurance', oauth, app.controller.web.defaultPage);
  app.get('/anxinInsurance_notice', oauth, app.controller.web.defaultPage);
  app.get('/InsuranceBuy', oauth, app.controller.web.InsuranceBuy);
  app.get('/insuranceListVision2', oauth, app.controller.web.defaultPage);
  app.get('/partSoldLogin', oauth, app.controller.web.defaultPage);
  app.get('/partSoldDetail', oauth, app.controller.web.defaultPage);
  app.get('/DoctorGo', oauth, app.controller.web.DoctorGo);
  app.get('/YSGC', oauth, app.controller.web.YSGC);
  app.get(
    '/zhonghuiCancer/:insuranceId',
    oauth,
    app.controller.web.zhonghuiCancer
  );
  app.get('/doctorList', oauth, app.controller.web.doctorList);
  app.get('/doctorListDetail', oauth, app.controller.web.doctorListDetail);
  app.get('/reportList', oauth, app.controller.web.reportList);
  app.get('/reportProductions', oauth, app.controller.web.reportProductions);
}

function api(app) {
  const oauth = app.middlewares.weixinNeedOauth(app.config, app);
  const wxApi = app.middlewares.weixinApi(app.config, app);
  const apiErrorCode = app.middlewares.apiErrorCode(app.config, app);
  const fileParse = app.middlewares.fileParse(app.config, app);
  const qiyuAuth = app.middlewares.qiyuAuth(app.config.qiyu, app);
  app.get('/api/bind', apiErrorCode, oauth, app.controller.api.bind);
  app.get('/api/hospital', apiErrorCode, app.controller.api.hospital);
  app.get('/api/hospital/:hospitalId/drugs', apiErrorCode, app.controller.api.druglist);
  app.get('/api/address', apiErrorCode, app.controller.api.address);
  app.get('/api/geocode', apiErrorCode, app.controller.api.geocode);
  app.get('/api/orders', apiErrorCode, app.controller.api.getOrders);
  app.get('/api/barcode', app.controller.api.barcode);
  app.get('/api/hospital/:hospitalId/drugs/:drugId', apiErrorCode, app.controller.api.drugDetail);
  app.post('/api/orders/:orderId/cancel', apiErrorCode, app.controller.api.cancelReason);
  app.post('/api/patient-sms-send', apiErrorCode, app.controller.api.smsSend);
  // 验证手机验证码
  app.post('/api/verify-patient', apiErrorCode, app.controller.api.verifyPatient);
  app.post('/api/bind/patient/:patientId', apiErrorCode, oauth, wxApi, app.controller.api.bindPatient);
  app.post('/api/js-api-config', apiErrorCode, wxApi, app.controller.api.jsApiConfig);
  app.post('/qiyu/user-info', qiyuAuth, app.controller.api.qiyuUserInfo);
  app.post('/qiyu/user-orders', qiyuAuth, app.controller.api.qiyuUserOrder);
  app.post('/api/patient/:patientId/verifyOrder', apiErrorCode, oauth, app.controller.api.verifyOrder);
  app.post('/api/patient/:patientId/order', apiErrorCode, oauth, app.controller.api.postOrder);
  app.post('/api/patient/:patientId/order/norule', apiErrorCode, app.controller.api.postOrderNoRule);
  app.get('/api/patient/:patientId/order', apiErrorCode, oauth, app.controller.api.getOrder);
  app.get('/api/patient/:patientId/drugs', apiErrorCode, oauth, app.controller.api.getPatientDrugs);
  app.get('/api/userInfo', apiErrorCode, app.controller.api.getUserInfo);
  app.get('/api/:hospitalId/doctors', apiErrorCode, app.controller.api.getDoctors);
  app.get('/api/packages', apiErrorCode, app.controller.api.getPackages);
  app.get('/api/:patientId/patientDetail', apiErrorCode, app.controller.api.getPatientDetail);
  //网页版单独注册 不用oauth 校验
  app.get('/api/local-hospital', apiErrorCode, app.controller.api.localHospital);
  app.post('/api/potentialPatients', apiErrorCode, app.controller.api.potentialPatients);
  app.get('/api/mobiles/:mobilePhone/verify', apiErrorCode, app.controller.api.activeMobileVerify);

  //初始化服务号导航目录
  app.get('/initMenu', apiErrorCode, app.controller.weixin.initMenu);

  //初始化服务号导航目录
  app.get('/initUnionId', apiErrorCode, app.controller.weixin.initUnionId);


  //获取客服联系方式
  app.get('/api/contact', apiErrorCode, app.controller.api.getContactNo);
  //查询患者
  app.get('/api/patients/signCheck', apiErrorCode, app.controller.api.checkSignPatients);
  // 检查签约的可用性
  app.get('/api/patients/bindCheck', apiErrorCode, app.controller.api.checkBindPatients);

  app.get('/api/patients/signCheck2', apiErrorCode, app.controller.api.checkSignPatients);
  app.post('/api/userSendCode', apiErrorCode, app.controller.api.userSendCode);
  app.post('/api/patients', apiErrorCode, app.controller.api.userRegister);
  app.post('/api/perfectInformation', apiErrorCode, app.controller.api.perfectInformation);

  // 拉新有礼详情
  app.get('/api/newPatient', apiErrorCode, app.controller.api.getPatientNewInfo);
  // 分享
  app.get('/api/sharePage', apiErrorCode, app.controller.api.shareNewPage);
  // 二维码
  app.get('/api/qr-code', apiErrorCode, app.controller.api.shareNewCode);
  // 获取全部接口
  app.get('/api/getWebUrl', apiErrorCode, app.controller.api.getAllUrl);
  // 获取地区信息
  app.get('/api/getPatientHos', apiErrorCode, app.controller.api.getPatientHos);

  //获取基础配置
  app.get('/api/cfg/enum/insurances', apiErrorCode, app.controller.api.getInsurances);
  app.get('/api/cfg/enum/diseases', apiErrorCode, app.controller.api.getDiseases);
  app.get('/api/cfg/enum/regions', apiErrorCode, app.controller.api.getRegions);

  //获取患者详情
  app.get('/api/patient/:patientId', apiErrorCode, app.controller.api.getPatientInfo);

  //查询绿A开通信息
  app.get('/api/openInfo', apiErrorCode, app.controller.api.openInfo);


  // 找药
  app.get('/api/drugsList', apiErrorCode, app.controller.api.getNewDrugList)
  // 社区药品表
  app.get('/api/getHosDrugDetail', apiErrorCode, app.controller.api.getHosDrugDetail)
  // 基础药品表
  app.get('/api/getBasisDrugDetail', apiErrorCode, app.controller.api.getBasisDrugDetail)
  // 添加需求单
  app.post('/api/addDrugToDemand', apiErrorCode, app.controller.api.addDrugToDemand)
  // 编辑需求单
  app.put('/api/patients/:patientId/requisitionForm/:formId', apiErrorCode, app.controller.api.updateDrugToDemand)
  // 查询需求单
  app.get('/api/queryDemandList', apiErrorCode, app.controller.api.queryDemandList)
  // 查询绿A开通信息
  app.get('/api/openInfo', apiErrorCode, app.controller.api.getAopenInfo)
  //上传处方图片
  app.post('/api/uploadImages', fileParse, app.controller.api.uploadImages)
  //获取积分信息
  app.get('/api/patient/:patientId/rewardpoints', apiErrorCode, app.controller.api.getPoint);
  app.get('/api/patient/:patientId/rewardpoints/record', apiErrorCode, app.controller.api.getPointRecord);
  app.get('/api/checkPatient', apiErrorCode, app.controller.api.checkPatient);

  app.get('/api/patients/:patientId/receiverAddress', apiErrorCode, app.controller.api.receiverAddress);
  app.post('/api/patients/:patientId/receiverAddress', apiErrorCode, app.controller.api.addReceiverAddress);
  app.put('/api/patients/:patientId/receiverAddress/:id', apiErrorCode, app.controller.api.updateReceiverAddress);
  app.delete('/api/patients/:patientId/receiverAddress/:id', apiErrorCode, app.controller.api.deleteReceiverAddress);

  // 获取一键续订
  app.get('/api/queryOrderCommonList', apiErrorCode, app.controller.api.queryOrderCommonList)

  //获取当前患者
  app.get('/api/currentPatient', oauth, app.controller.api.currentPatient);
  //获取当前微信用户信息
  app.get(`/api/currentUser`, oauth, app.controller.api.currentWeixinUser)

  //获取患者可用积分
  app.get('/api/patient/:patientId/rewardpoints', oauth, app.controller.api.rewardpoints);
  //获取患者抵扣积分后福利
  app.post('/api/patients/:patientId/welfare', app.controller.api.welfare);

  app.get('/api/patients/:patientId/defaultStoreAddress', oauth, app.controller.api.defaultStoreAddress);
  app.post('/api/patients/:patientId/defaultStoreAddress', oauth, app.controller.api.updateDefaultStoreAddress);
  // 查询方案详情
  app.get(
    '/api/insurance_package/:packageId/specifications',
    oauth,
    app.controller.api.getServiceArticleList
  );

  //获取运费
  app.get('/api/patient/:patientId/freight', app.controller.api.getPatientFreight);

  //创建保险
  app.get('/api/insurance_packages/:insurancePackageId/products', oauth, app.controller.api.getInsuranceProducts);
  app.get('/api/insurance_packages/:insurancePackageId/disease_inquiries', oauth, app.controller.api.getInsuranceDiseaseInquiries);
  app.get('/api/insurance_packages/:insurancePackageId/disease_inquiries/v2', oauth, app.controller.api.getInsuranceDiseaseInquiriesVersion2);
  app.post('/api/patients/insurance_orders', oauth, app.controller.api.creatInsuranceOrder);
  // 激活服务
  app.post('/api/insurance_order/insure/:insureOrderNo', oauth, app.controller.api.activeInsure);
  app.post('/api/v2/insurance_order/insure/:insureOrderNo', oauth, app.controller.api.activeInsureQuestion);

  app.post('/api/patients/:patientId/insurance_orders/:insuranceOrderId/pay', oauth, app.controller.api.payInsuranceOrder);
  
  // 药品订单
  app.post('/api/orders/:orderId/pay', app.controller.api.createMedicineOrder);
    
  app.get('/api/idCardCheck', oauth, app.controller.api.idCardCheck);

  /* 查询供药目录药品 */
  app.get('/api/warehouses', oauth, app.controller.api.getWarehouseDrugs);
  /* 提交凭证 */
  app.post('/api/patients/:patientId/purchaseVoucher', oauth, app.controller.api.createPurchaseVoucher)


  /* 保险订单列表 */
  app.get('/api/patients/:patientId/insuranceOrder', oauth, app.controller.api.getInsuranceOrderList);
  /* 保险订单列表 */
  app.get('/api/patients/:patientId/insurance_orders/:insuranceOrderId/insurance_order_bills/:insuranceOrderBillId/payment_info/:payOrderId', oauth, app.controller.api.getInsurancePayInfo);
  /* 保险订单详情 */
  app.get('/api/patients/insurance_order/:orderId', oauth, app.controller.api.getInsuranceOrderInfo);

  /* 用户实名认证 */
  app.post('/api/patients/:patientId/patientCertification', app.controller.api.updatePatientCertification);

  app.get('/api/ads', oauth, app.controller.api.getAdsBanner);

  app.get('/api/insurances', oauth, app.controller.api.insuranceList);
  //保险配置
  app.get('/api/insurance/:insuranceId/config', app.controller.api.insuranceConfigInfo);

  app.get('/api/insurances/config', app.controller.api.insuranceConfigList)
  //校验用户是否可以上保险
  app.get('/api/insurance_order/verifyPatientInsuranceOrder', app.controller.api.verifyPatientInsuranceOrder);

  /* 获取身高 */
  app.get('/api/patient/:patientId/bodyMass', oauth, app.controller.api.getBodyMassList)
  /* 提交身高体重 */
  app.post(`/api/patient/bodyMass`, oauth, app.controller.api.subBodyMass)
  /* 获取活动code */
  app.get(`/api/patient/shareCode`, oauth, app.controller.api.getShareCode)
  /* 获取转发成功 */
  app.post(`/api/patient/shareNum`, oauth, app.controller.api.getShareNum)

  /* 积分兑换 */
  app.get(`/api/pointExchange`, oauth, app.controller.api.pointExchange)
  app.get(`/api/pointExchange/:exchangeId`, oauth, app.controller.api.pointExchangeInfo)
  // app.get('/api/download', app.controller.api.downLoadFile);
  /* 获取省市 */
  app.get('/api/cityList', oauth, app.controller.api.cityList)
  /* 保存省市 */
  app.get('/api/saveCityList', oauth, app.controller.api.saveCity)
  /* 修改签约机构 */
  app.post(`/api/checkHospital`, oauth, app.controller.api.checkHospital)
  /** */
  app.post(`/api/patients/:patientId/insuranceOrders/:insuranceOrderId/notification`, oauth, app.controller.api.postNotificationForInsurance);

  app.get(`/api/patients/available`, oauth, app.controller.api.getPatientsAvailable);

  /* 保险页面图片获取 */
  app.get(`/api/insurance/:insurancePackageId/imgList`, oauth, app.controller.api.getInusranceImgList)
  app.get(`/api/getBaseDrug`, oauth, app.controller.api.getBaseDrug)
  app.get(`/api/getDefaultDrugList`, oauth, app.controller.api.getDefaultDrugs)
  app.get('/api/getMedicationEvaluationList', oauth, app.controller.api.getMedicationEvaluationList)
  app.post('/api/submitEvaluation/:patientId', oauth, app.controller.api.submitEvaluation)
  app.get('/api/medicationEvaluation', oauth, app.controller.api.medicationEvaluation)
  app.get('/api/patient/insurance_order/inservice', oauth, app.controller.api.getPatientInsuranceService)

  /* 查询文章 */
  app.get('/api/getArticles', app.controller.api.getArticles)
  /* 查询文章详情 */
  app.get('/api/getArticleDetail', app.controller.api.getArticleDetail)
  /* 获取疾病 */
  app.get('/api/diseases', oauth, app.controller.api.getHealthDiseases)
  /* 提交 */
  app.post('/api/environmentAssessment', oauth, app.controller.api.submitEnvironmentAssessment)
  /* 获取领取人数 */
  app.get('/api/getOrderCount', oauth, app.controller.api.getOrderCount)

  /** 查询文章分类 */
  app.get('/api/wcm/articleCategorise', app.controller.pbm3Api.getArticleCategorise)

  /**PBM 3.0 */
  app.get('/api/wcm/adpositions/ads', app.controller.pbm3Api.getAdpositionsAds)
  app.get('/api/wcm/articles', app.controller.pbm3Api.getArticles)
  app.get('/api/wcm/todayOptimization', oauth, app.controller.pbm3Api.getTodayOptimization)

  /* 获取广告 */
  app.get('/api/wcm/adpositions/ads', app.controller.api.getAdpositions)
  /* 获取小程序码 */
  app.get('/api/getCodeImg', oauth, app.controller.api.getCodeImg)
  /* 获取小程序码 */
  app.get('/api/insurance_order/fork_code', oauth, app.controller.api.checkForkCode)
  /* 获取激活 */
  app.get('/api/getCodeStatus', oauth, app.controller.api.getCodeStatus)
  /* 合并用户 */
  app.post('/api/patients/merge', oauth, app.controller.api.mergePatient)
  // 获取购买历史记录
  app.get('/api/insurance_order/histories', oauth, app.controller.api.getHistories)
  // 服务包查询
  app.get('/api/insurance_packages', oauth, app.controller.api.getHomeInsurancelist)

  app.get('/api/del_bind', oauth, app.controller.api.debugDelBind)
  /* 查看保障列表 */
  app.get('/api/get_insurance_team_order', oauth, app.controller.api.getInsuranceTeamOrder)
  /* 生成保险激活码 */
  app.get(`/api/insurance_packages/activationCode`, oauth, app.controller.api.getinsuranceCode)
  /* 创建移山工程活动用户 */
  app.get(`/api/isActive`, oauth, app.controller.api.createYsgcuser)
  /* 查询是否参加过移山工程项目 */
  app.get(`/api/getActive`, oauth, app.controller.api.getYsgcuser)
  app.get(`/api/edituserInfo`, oauth, app.controller.api.edituserInfo)
  //获取问诊记录
  app.get(`/api/doctorList/:id`, oauth, app.controller.api.doctorList)
  //获取体检服务
  app.get(`/api/mecService/:id`, oauth, app.controller.api.mecService)
  //绑定体检卡
  app.get(`/api/hd/medicalExaminationCards/binding/:id/:patientId`, oauth, app.controller.api.mecServicebind)
  //发送体检卡
  app.get(`/api/hd/medicalExaminationCards/send/:id`, oauth, app.controller.api.mecServicesend)

  //获取服务包配置的问询
  app.get(`/api/insurance_package/:packageId/inquiries`, oauth, app.controller.api.getInquiry)
  // 查询直赔余额
  app.get(`/api/patient/:patientId/enterprisewelfare/remainamount`, app.controller.api.queryEnterpriseRemainAmount)
  //获取服务包问询
  app.get(`/api/getenquiry/:id`, oauth, app.controller.api.getenquiry)

}
